package com.fg.pro.model.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    //TODO 不想在拦截器获取用户信息，需要IO交互影响性能，所以只将userId从网关处拿出来，如果以后考虑需要用户信息，这里需要调整
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserIdInterceptor()).addPathPatterns("/**");
    }

}
